<?php 
    if(!((isset($_SESSION['bg_login']['bg_username']) && isset($_SESSION['bg_login']['bg_level']) && $_SESSION['bg_login']['bg_level'] == 1)
         || (isset($_COOKIE['bg_username'])&& isset($_COOKIE['bg_level']) && $_COOKIE['bg_level'] == 1 ))){
         $getUrl = $api->curPageURL();
         if(!empty($getUrl)){
             header("Location:".BASE_URL_ADMIN."?com=login&action=".$getUrl);
         }else{
             header("Location:".BASE_URL_ADMIN."?com=login");
         }
         
    }
?>